package org.fast.develop.logicflow.core.meta.shape.task;

import org.fast.develop.logicflow.core.meta.base.Ref;
import org.fast.develop.logicflow.core.meta.base.Resource;
import org.fast.develop.logicflow.core.meta.base.task.Task;
import org.fast.develop.logicflow.core.meta.shape.properties.ServiceTaskProperties;

import java.util.ArrayList;
import java.util.List;

/**
 * @author 莫寅
 * @createTime 2022-11-23 02:09
 * @desc：
 */
public class ServiceTask<P extends ServiceTaskProperties> extends Resource<P> implements Task<P> {

    private List<Ref> incoming = new ArrayList<>();
    private List<Ref> outgoing = new ArrayList<>();


    @Override
    public List<Ref> getIncoming() {
        return incoming;
    }

    public void setIncoming(List<Ref> incoming) {
        this.incoming = incoming;
    }

    @Override
    public List<Ref> getOutgoing() {
        return outgoing;
    }

    @Override
    public void setOutgoing(List<Ref> outgoing) {
        this.outgoing = outgoing;
    }

    @Override
    public Class<P> getPropertiesClass() {
        return (Class<P>) ServiceTaskProperties.class;
    }

    @Override
    public String toString() {

        return "ServiceTask{" +
                "resourceId='" + getResourceId() + '\'' +
                ", incoming=" + incoming +
                ", outgoing=" + outgoing +
                ", properties=" + getProperties() +
                '}';
    }
}
